//
//  chattingViewController.m
//  Final
//
//  Created by lanou3g on 15/12/5.
//  Copyright © 2015年 皮比诺. All rights reserved.
//

#import "chattingViewController.h"
#import "CZMessage.h"
#import "CZMessageCell.h"
#import "CZMessageFrame.h"
//#import "chathandle.h"
@interface chattingViewController ()<UITableViewDataSource, UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIButton *imagebutton;
@property (weak, nonatomic) IBOutlet UIButton *audioButton;

@property (weak, nonatomic) IBOutlet UIButton *sendButton;
@property(nonatomic, strong)NSMutableArray *chartingArray;
@property(nonatomic,strong)NSMutableArray *messageFrame;
@end

@implementation chattingViewController

- (BOOL)prefersStatusBarHidden
{
    return YES;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    //去掉分割线
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.allowsSelection = NO;
    //背景颜色
    self.tableView.backgroundColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1];

    NSLog(@"哈哈哈");
    
}


- (void)viewWillAppear:(BOOL)animated
{
    
    [super viewWillAppear:YES];
//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dosomething:) name:@"123" object:nil];
    
    
    
}


//- (void)dosomething:(id)sender
//{
////    NSArray *array = nil;
////    array = (NSArray *)sender;
////    self.chartingArray = array.mutableCopy;
////    NSLog(@"%@", self.chartingArray);
//    
//}

//
//- (NSMutableArray *)messageFrame
//{
//    
//    return nil;
//
//}



#pragma mark -- 数据源的方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 15;
}


- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//    测试
    
//    //创建爱你自定义的可重用的cell
    CZMessageCell * cell = [CZMessageCell messageCellWithTableview:tableView];
//    
//    //给子控件赋值
//    CZMessage *message = [[CZMessage alloc]init];
//    
//    message.time = @"2015:13:00";
//    
//    if (indexPath.row % 2 == 0) {
//        message.type = CZMessageTypeSelf;
//        message.text = @"你2B";
//     
//        
//    }else{
//        message.type = CZMessageTypeOther;
//        message.text = @"你SB";
//        
//        
//    }
//    
//        CZMessageFrame *frame = [[CZMessageFrame alloc]init];
//    frame.message = message;
//    [self.array addObject:frame];
//    
//    cell.messageFrame = frame;
//    
//
//    
//    
//    return cell;
    
    return cell;
    
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
//    return [self.array[indexPath.row] rowHeight];
    
    return 50;
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
